From: Rotem Liss Date: Sun, 19 Apr 2009 20:25:28 +0000 (+0000) Subject: Follow-up to r49558: Remove per-message comments support from rebuildLanguage.php. X-Git-Tag: 1.31.0-rc.0~42105 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=8056a14724a2e2d301ae6b3c580d85475b5b97dc;p=lhc%2Fweb%2Fwiklou.git Follow-up to r49558: Remove per-message comments support from rebuildLanguage.php. --- diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 8ff6406b98..9ba6fe465f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -3170,9 +3170,3 @@ Variants for Chinese language", 'special-tags' => 'Special:Tags', 'db-error-messages' => 'Database error messages', ); - -/** Short comments for standalone messages - * deprecated - explanations in MessagesQqq.php now. - */ -$wgMessageComments = array( -); diff --git a/maintenance/language/writeMessagesArray.inc b/maintenance/language/writeMessagesArray.inc index 3a279cb632..e28a5c04f7 100644 --- a/maintenance/language/writeMessagesArray.inc +++ b/maintenance/language/writeMessagesArray.inc @@ -15,7 +15,6 @@ class MessageWriter { static $messageStructure; static $blockComments; - static $messageComments; static $ignoredMessages; static $optionalMessages; @@ -79,13 +78,11 @@ class MessageWriter { require( $dir . '/messages.inc' ); self::$messageStructure = $wgMessageStructure; self::$blockComments = $wgBlockComments; - self::$messageComments = $wgMessageComments; require( $dir . '/messageTypes.inc' ); self::$ignoredMessages = $wgIgnoredMessages; self::$optionalMessages = $wgOptionalMessages; - # Sort messages to blocks $sortedMessages['unknown'] = $messages; foreach( self::$messageStructure as $blockName => $block ) { @@ -113,7 +110,7 @@ class MessageWriter { $ignored = array(); $optional = array(); } - $comments = self::makeComments( array_keys($messages), self::$messageComments, $ignored, $optional ); + $comments = self::makeComments( array_keys( $messages ), $ignored, $optional ); # Write the block $messagesText .= self::writeMessagesBlock( self::$blockComments[$block], $messages, $comments ); @@ -134,33 +131,19 @@ class MessageWriter { * Generates an array of comments for messages. * * @param $messages Key of messages. - * @param $comments Comments for messages, indexed by key. * @param $ignored List of ingored message keys. * @param $optional List of optional message keys. */ - public static function makeComments( $messages, $comments, $ignored, $optional ) { + public static function makeComments( $messages, $ignored, $optional ) { # Comment collector $commentArray = array(); # List of keys only foreach( $messages as $key ) { - $commentsForKey = array(); - - # Add descriptive comment for this message if there is one - if( array_key_exists( $key, $comments ) ) { - $commentsForKey[] = $comments[$key]; - } - - # For translator information only if( in_array( $key, $ignored ) ) { - $commentsForKey[] = self::$ignoredComment; + $commentArray[$key] = ' # ' . self::$ignoredComment; } elseif( in_array( $key, $optional ) ) { - $commentsForKey[] = self::$optionalComment; - } - - # Format one or more comments nicely and store in array - if( count( $commentsForKey ) ) { - $commentArray[$key] = ' # ' . implode( '; ', $commentsForKey ); + $commentArray[$key] = ' # ' . self::$optionalComment; } }